<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>


<script type="text/javascript" src="Content/js/taikhoan.js"></script>

<link rel="stylesheet" type="text/css"
	href="Content/css/Admin/lietKeTaiKhoan.css" />
<link rel="stylesheet" type="text/css"
	href="Content/css/Admin/lietKeComment.css" />	

<div class="main_content">
	<div class="mycolor"><h4>${title }</h4></div>
	<div><h4>${ketqua }</h4></div>
	<div style="width:100%;float:left;">
			<div style="float:left;width:500px;">
				<div style="float:left;width:300px;">
					<label style="width:70px;margin-top:26px;font-size:14px;">Xếp theo</label>
					 <form style="float:right;margin-top:-28px;margin-right:20px;" action="${Servlet}&trang=1" method="POST">
					    	<select style="width:200px;" name="kieuSort"  onchange='submit()' >					
								<option value="1" <c:if test="${kieuSort==1 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Tên Đăng Nhập(từ A->Z)"></c:out></option>
								<option value="2" <c:if test="${kieuSort==2 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Tên Đăng Nhập(từ Z->A)"></c:out></option>
								<option value="3" <c:if test="${kieuSort==3 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Họ Tên (Tăng dần)"></c:out></option>
								<option value="4" <c:if test="${kieuSort==4 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Họ Tên (Giảm dần)"></c:out></option>
					   		 </select>
					  </form>
				</div>
				<div style="float:right;width:200px;">
					<label  style="width:100px;margin-top:26px;float:left;font-size:14px;margin-left:10px;">Hiển thị</label>
					 <form style="display:inline;width:60px;float:left;margin-top:23px;" action="${Servlet}&trang=1" method="POST">
					    	<select style="width:60px;" name="slusertt"  onchange='submit()' >
					    	<c:set var="usertt" value="${requestScope.soBookTrenTrang }"></c:set>
								<c:forEach var="i" begin="1" end="5">
									<option value="${ i*usertt }" <c:if test="${i*usertt==slusertt }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="${ i*usertt }"></c:out></option>
								</c:forEach>		
					   		 </select>
					  </form>
				</div>
			</div>
			<div style="float:right;margin:3px;width:430px;">
				<label style="width:50px;margin-top:23px;float:left;font-size:14px;">Trang</label>
				<div class="pagination" style="display:inline;width:380px;float:left;">
					<ul>

						<c:choose>
							<c:when test="${trangHienTai > 1 }">
								<li><a
									href="${Servlet}&trang=${trangHienTai - 1}&slusertt=${slusertt}">«</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="#">«</a></li>
							</c:otherwise>
						</c:choose>
						<!-- do dai pagination -->
						<c:choose>
							<c:when test="${tongSoTrang <= 6}">
								<c:forEach var="i" begin="1" end="${tongSoTrang}"
									step="1">
									<c:choose>
										<c:when test="${trangHienTai == i }">
											<li class="active"><a
												href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
											</a></li>
										</c:when>
										<c:otherwise>
											<li><a
												href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
											</a></li>
										</c:otherwise>
									</c:choose>
								</c:forEach>
							</c:when>
							<c:otherwise>
								<c:choose>
									<c:when test="${trangHienTai <= 3 }">
										<!--  khi page hiện tại là 1 trong 2 page đầu -->
										<c:forEach var="i" begin="1" end="5" step="1">
											<c:choose>
												<c:when test="${trangHienTai == i }">
													<li class="active"><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:when>
												<c:otherwise>
													<li><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
										<li><a>...</a></li>
										<li><a
											href="${Servlet}&trang=${tongSoTrang}&slusertt=${slusertt}">${tongSoTrang}
										</a></li>
									</c:when>
									<c:when
										test="${trangHienTai >= tongSoTrang - 1 }">
										<!--  khi page hiện tại là 1 trong 2 page cuối -->

										<li><a
											href="${Servlet}&trang=${1}&slusertt=${slusertt}">1
										</a></li>
										<li><a>...</a></li>
										<c:forEach var="i" begin="${ tongSoTrang - 4}"
											end="${ tongSoTrang}" step="1">
											<c:choose>
												<c:when test="${trangHienTai == i }">
													<li class="active"><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:when>
												<c:otherwise>
													<li><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</c:when>
									<c:otherwise>
										<c:choose>
											<c:when
												test="${ trangHienTai + 4 <= tongSoTrang }">
												<li><a
													href="${Servlet}&trang=${1}&slusertt=${slusertt}">1
												</a></li>
												<li><a>...</a></li>
												<c:forEach var="i" begin="${ trangHienTai - 1}"
													end="${ trangHienTai + 2}" step="1">
													<c:choose>
														<c:when test="${trangHienTai == i }">
															<li class="active"><a
																href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
															</a></li>
														</c:when>
														<c:otherwise>
															<li><a
																href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
															</a></li>
														</c:otherwise>
													</c:choose>
												</c:forEach>

												<li><a>...</a></li>
												<li><a
													href="${Servlet}&trang=${tongSoTrang}&slusertt=${slusertt}">${tongSoTrang}
												</a></li>
											</c:when>
											<c:otherwise>
												<li><a
													href="${Servlet}&trang=${1}&slusertt=${slusertt}">1
												</a></li>
												<li><a>...</a></li>
												<c:forEach var="i" begin="${ tongSoTrang - 4}"
													end="${ tongSoTrang}" step="1">
													<c:choose>
														<c:when test="${trangHienTai == i }">
															<li class="active"><a
																href="${Servlet}&trang=${i}&slbooktt=${slbooktt}">${i}
															</a></li>
														</c:when>
														<c:otherwise>
															<li><a
																href="${Servlet}&trang=${i}&slbooktt=${slbooktt}">${i}
															</a></li>
														</c:otherwise>
													</c:choose>
												</c:forEach>
											</c:otherwise>
										</c:choose>
									</c:otherwise>

								</c:choose>
							</c:otherwise>
						</c:choose>

						<!-- do dai pagination -->
						<c:choose>
							<c:when
								test="${trangHienTai < tongSoTrang }">
								<li><a
									href="${Servlet}&trang=${trangHienTai + 1}&slbooktt=${slbooktt}">»</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="#">»</a></li>
							</c:otherwise>
						</c:choose>

					</ul>
				</div>
			</div>
		</div>
	<br>
	<div style="width:100%; height:auto;float:left;">
		<c:forEach var="tk" items="${requestScope.listTaiKhoan}">
			<div class="contentTopTen">			
					<table class="table table-striped" width="100%">
						<tr>
							<td width="30%">Tên tài khoản</td>
							<td width="70%"><a title="Liệt các comment của tài khoản này" href="LietKeCommentTheoUser.do?userid=${tk.userId }&save=false&slcmtt=${requestScope.soBookMacDinh}&trang=1"><c:out value="${tk.userId }" /></a></td>
						</tr>
						<tr>
							<td  width="30%">Họ tên</td>
							<td width="70%"><c:out value="${tk.name }" /></td>
						</tr>
						<tr>
							<td  width="30%">Điện thoại</td>
							<td width="70%"><c:out value="${tk.phone}" /></td>
						</tr>
						<tr>
							<td  width="30%">Email</td>
							<td width="70%"><c:out value="${tk.email}" /></td>
						</tr>
						<tr>
							<td  width="30%">Địa chỉ</td>
							<td width="70%"><c:out value="${tk.address}" /></td>
						</tr>
						<tr>
							<td  width="30%">Trạng thái tài khoản</td>
							<td width="70%"><c:out value="${tk.status.status}" /></td>
						</tr>
					
					</table>
					<div class="buttonTopTen">
					<a class="btn btn-inverse"
						href="XoaTaiKhoan.do?userId=${tk.userId}">Xóa</a>
				</div>
				<div class="buttonTopTen">
					<a class="btn btn-warning"
						href="BanTaiKhoan.do?userId=${tk.userId}">
						<c:if test="${tk.status.idstatus == 5}">
							<c:out value="UnBan"></c:out>
						</c:if> 
						<c:if test="${tk.status.idstatus == 4}">
							<c:out value="Ban"></c:out>
						</c:if></a>
				</div>		
			</div>
		</c:forEach>
	</div>
	<div style="width:100%;float:left;">
			<div style="float:left;width:500px;">
				<div style="float:left;width:300px;">
					<label style="width:70px;margin-top:26px;font-size:14px;">Xếp theo</label>
					 <form style="float:right;margin-top:-28px;margin-right:20px;" action="${Servlet}&trang=1" method="POST">
					    	<select style="width:200px;" name="kieuSort"  onchange='submit()' >					
								<option value="1" <c:if test="${kieuSort==1 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Tên Đăng Nhập(từ A->Z)"></c:out></option>
								<option value="2" <c:if test="${kieuSort==2 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Tên Đăng Nhập(từ Z->A)"></c:out></option>
								<option value="3" <c:if test="${kieuSort==3 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Họ Tên (Tăng dần)"></c:out></option>
								<option value="4" <c:if test="${kieuSort==4 }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="Họ Tên (Giảm dần)"></c:out></option>
					   		 </select>
					  </form>
				</div>
				<div style="float:right;width:200px;">
					<label  style="width:100px;margin-top:26px;float:left;font-size:14px;margin-left:10px;">Hiển thị</label>
					 <form style="display:inline;width:60px;float:left;margin-top:23px;" action="${Servlet}&trang=1" method="POST">
					    	<select style="width:60px;" name="slusertt"  onchange='submit()' >
					    	<c:set var="usertt" value="${requestScope.soBookTrenTrang }"></c:set>
								<c:forEach var="i" begin="1" end="5">
									<option value="${ i*usertt }" <c:if test="${i*usertt==slusertt }"><c:out value="selected=\"selected\""></c:out></c:if> ><c:out value="${ i*usertt }"></c:out></option>
								</c:forEach>		
					   		 </select>
					  </form>
				</div>
			</div>
			<div style="float:right;margin:3px;width:430px;">
				<label style="width:50px;margin-top:23px;float:left;font-size:14px;">Trang</label>
				<div class="pagination" style="display:inline;width:380px;float:left;">
					<ul>

						<c:choose>
							<c:when test="${trangHienTai > 1 }">
								<li><a
									href="${Servlet}&trang=${trangHienTai - 1}&slusertt=${slusertt}">«</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="#">«</a></li>
							</c:otherwise>
						</c:choose>
						<!-- do dai pagination -->
						<c:choose>
							<c:when test="${tongSoTrang <= 6}">
								<c:forEach var="i" begin="1" end="${tongSoTrang}"
									step="1">
									<c:choose>
										<c:when test="${trangHienTai == i }">
											<li class="active"><a
												href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
											</a></li>
										</c:when>
										<c:otherwise>
											<li><a
												href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
											</a></li>
										</c:otherwise>
									</c:choose>
								</c:forEach>
							</c:when>
							<c:otherwise>
								<c:choose>
									<c:when test="${trangHienTai <= 3 }">
										<!--  khi page hiện tại là 1 trong 2 page đầu -->
										<c:forEach var="i" begin="1" end="5" step="1">
											<c:choose>
												<c:when test="${trangHienTai == i }">
													<li class="active"><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:when>
												<c:otherwise>
													<li><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
										<li><a>...</a></li>
										<li><a
											href="${Servlet}&trang=${tongSoTrang}&slusertt=${slusertt}">${tongSoTrang}
										</a></li>
									</c:when>
									<c:when
										test="${trangHienTai >= tongSoTrang - 1 }">
										<!--  khi page hiện tại là 1 trong 2 page cuối -->

										<li><a
											href="${Servlet}&trang=${1}&slusertt=${slusertt}">1
										</a></li>
										<li><a>...</a></li>
										<c:forEach var="i" begin="${ tongSoTrang - 4}"
											end="${ tongSoTrang}" step="1">
											<c:choose>
												<c:when test="${trangHienTai == i }">
													<li class="active"><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:when>
												<c:otherwise>
													<li><a
														href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
													</a></li>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</c:when>
									<c:otherwise>
										<c:choose>
											<c:when
												test="${ trangHienTai + 4 <= tongSoTrang }">
												<li><a
													href="${Servlet}&trang=${1}&slusertt=${slusertt}">1
												</a></li>
												<li><a>...</a></li>
												<c:forEach var="i" begin="${ trangHienTai - 1}"
													end="${ trangHienTai + 2}" step="1">
													<c:choose>
														<c:when test="${trangHienTai == i }">
															<li class="active"><a
																href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
															</a></li>
														</c:when>
														<c:otherwise>
															<li><a
																href="${Servlet}&trang=${i}&slusertt=${slusertt}">${i}
															</a></li>
														</c:otherwise>
													</c:choose>
												</c:forEach>

												<li><a>...</a></li>
												<li><a
													href="${Servlet}&trang=${tongSoTrang}&slusertt=${slusertt}">${tongSoTrang}
												</a></li>
											</c:when>
											<c:otherwise>
												<li><a
													href="${Servlet}&trang=${1}&slusertt=${slusertt}">1
												</a></li>
												<li><a>...</a></li>
												<c:forEach var="i" begin="${ tongSoTrang - 4}"
													end="${ tongSoTrang}" step="1">
													<c:choose>
														<c:when test="${trangHienTai == i }">
															<li class="active"><a
																href="${Servlet}&trang=${i}&slbooktt=${slbooktt}">${i}
															</a></li>
														</c:when>
														<c:otherwise>
															<li><a
																href="${Servlet}&trang=${i}&slbooktt=${slbooktt}">${i}
															</a></li>
														</c:otherwise>
													</c:choose>
												</c:forEach>
											</c:otherwise>
										</c:choose>
									</c:otherwise>

								</c:choose>
							</c:otherwise>
						</c:choose>

						<!-- do dai pagination -->
						<c:choose>
							<c:when
								test="${trangHienTai < tongSoTrang }">
								<li><a
									href="${Servlet}&trang=${trangHienTai + 1}&slbooktt=${slbooktt}">»</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="#">»</a></li>
							</c:otherwise>
						</c:choose>

					</ul>
				</div>
			</div>
		</div>
</div>

<script>

</script>